package day03;

public class OperDemo3 {
    public static void main(String[] args) {
        //逻辑运算符:&&,||,!
        //&&与,有f则f
        /*
        int a=5,b=10,c=5;
        boolean b1= b>=a && b<c;
        System.out.println(b1);//f
        System.out.println(b<=c && b>a);//f
        System.out.println(a==b && c>b);//f
        System.out.println(b!=c && a<b);//t

        int age=40;
        System.out.println(age>=18 && age<=50);//t
        int score=59;
        System.out.println(score>=60 && score<=100);//f

         */
        //||或,有t则t,非!
        /*
        int a=5,b=10,c=5;
        System.out.println(b>=a || b<c);//t
        System.out.println(b<=c || b>a);//t
        System.out.println(b!=c || a<b);//t
        System.out.println(a==b || b<c);//f
        int score = 90;
        System.out.println(score<0 || score>100);//f 成绩不合法验证
        System.out.println("---------------");
        //非
        boolean b2 = !(a<b);
        System.out.println(b2);//f
        System.out.println(!(a>b));//t

         */
        //与或短路
        /*
        int a=5,b=10,c=5;
        boolean b3 = a>b && c++>2;
        System.out.println(b3);//f
        System.out.println(c);//5,a>b false直接输出把c++短路

        boolean b4 = a<b || c++>2;
        System.out.println(b4);//t
        System.out.println(c);//5

         */
    }
}